<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>Aria: ArModule Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Aria
   &#160;<span id="projectnumber">2.9.4</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li><a href="examples.html"><span>Examples</span></a></li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('classArModule.html','');});
</script>
<div id="doc-content">
<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pro-attribs">Protected Attributes</a> &#124;
<a href="classArModule-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">ArModule Class Reference<span class="mlabels"><span class="mlabel">abstract</span></span></div>  </div>
</div><!--header-->
<div class="contents">

<p>Dynamicly loaded module base class, read warning in more.  
 <a href="classArModule.html#details">More...</a></p>

<p><code>#include &lt;ArModule.h&gt;</code></p>

<p>Inherited by SimpleMod.</p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a11d2b4a25b1ea529a75dedd5c9aab74b"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a11d2b4a25b1ea529a75dedd5c9aab74b"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArModule.html#a11d2b4a25b1ea529a75dedd5c9aab74b">ArModule</a> ()</td></tr>
<tr class="memdesc:a11d2b4a25b1ea529a75dedd5c9aab74b"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructor. <br /></td></tr>
<tr class="separator:a11d2b4a25b1ea529a75dedd5c9aab74b"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6556f5f806fbbd4f25b0c6f0c2997984"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6556f5f806fbbd4f25b0c6f0c2997984"></a>
virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArModule.html#a6556f5f806fbbd4f25b0c6f0c2997984">exit</a> ()=0</td></tr>
<tr class="memdesc:a6556f5f806fbbd4f25b0c6f0c2997984"><td class="mdescLeft">&#160;</td><td class="mdescRight">Close down the module and have it exit. <br /></td></tr>
<tr class="separator:a6556f5f806fbbd4f25b0c6f0c2997984"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a548cc99c70edc3f7406fc938d3388e0c"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a548cc99c70edc3f7406fc938d3388e0c"></a>
<a class="el" href="classArRobot.html">ArRobot</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArModule.html#a548cc99c70edc3f7406fc938d3388e0c">getRobot</a> ()</td></tr>
<tr class="memdesc:a548cc99c70edc3f7406fc938d3388e0c"><td class="mdescLeft">&#160;</td><td class="mdescRight">Get the <a class="el" href="classArRobot.html" title="Central class for communicating with and operating the robot. ">ArRobot</a> pointer the module should be using. <br /></td></tr>
<tr class="separator:a548cc99c70edc3f7406fc938d3388e0c"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6774bb941d02907c8e4187011a9f3f8d"><td class="memItemLeft" align="right" valign="top">virtual bool&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArModule.html#a6774bb941d02907c8e4187011a9f3f8d">init</a> (<a class="el" href="classArRobot.html">ArRobot</a> *robot, void *argument=NULL)=0</td></tr>
<tr class="memdesc:a6774bb941d02907c8e4187011a9f3f8d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Initialize the module. The module should use the supplied <a class="el" href="classArRobot.html" title="Central class for communicating with and operating the robot. ">ArRobot</a> pointer.  <a href="#a6774bb941d02907c8e4187011a9f3f8d">More...</a><br /></td></tr>
<tr class="separator:a6774bb941d02907c8e4187011a9f3f8d"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abd953e39d1b2f40dd8a1a3eaee96c29e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abd953e39d1b2f40dd8a1a3eaee96c29e"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArModule.html#abd953e39d1b2f40dd8a1a3eaee96c29e">setRobot</a> (<a class="el" href="classArRobot.html">ArRobot</a> *robot)</td></tr>
<tr class="memdesc:abd953e39d1b2f40dd8a1a3eaee96c29e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set the <a class="el" href="classArRobot.html" title="Central class for communicating with and operating the robot. ">ArRobot</a> pointer. <br /></td></tr>
<tr class="separator:abd953e39d1b2f40dd8a1a3eaee96c29e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:afd2757f2cfab1587e56ef78015569359"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="afd2757f2cfab1587e56ef78015569359"></a>
virtual&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArModule.html#afd2757f2cfab1587e56ef78015569359">~ArModule</a> ()</td></tr>
<tr class="memdesc:afd2757f2cfab1587e56ef78015569359"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
<tr class="separator:afd2757f2cfab1587e56ef78015569359"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pro-attribs"></a>
Protected Attributes</h2></td></tr>
<tr class="memitem:a307f8ec063fbb0cb9e7ec1ed21d12422"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a307f8ec063fbb0cb9e7ec1ed21d12422"></a>
<a class="el" href="classArRobot.html">ArRobot</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classArModule.html#a307f8ec063fbb0cb9e7ec1ed21d12422">myRobot</a></td></tr>
<tr class="memdesc:a307f8ec063fbb0cb9e7ec1ed21d12422"><td class="mdescLeft">&#160;</td><td class="mdescRight">Stored <a class="el" href="classArRobot.html" title="Central class for communicating with and operating the robot. ">ArRobot</a> pointer that the module should use. <br /></td></tr>
<tr class="separator:a307f8ec063fbb0cb9e7ec1ed21d12422"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Dynamicly loaded module base class, read warning in more. </p>
<p>Right now only one module's init will be called, that is the first one, its a bug that I just don't have time to fix at the moment. I'll get to it when I have time or if someone needs it... someone else wrote this code so it'll take me a little longer to fix it.</p>
<p>This class defines a dyanicmly loaded module of code. This is usefull for an application to load piece of code that it does not know about. The <a class="el" href="classArModule.html" title="Dynamicly loaded module base class, read warning in more. ">ArModule</a> defines and interface in which to invoke that piece of code that the program does not know about. For instance, a module could contain an <a class="el" href="classArAction.html" title="Base class for actions. ">ArAction</a> and the modules <a class="el" href="classArModule.html#a6774bb941d02907c8e4187011a9f3f8d" title="Initialize the module. The module should use the supplied ArRobot pointer. ">init()</a> could instantiate the <a class="el" href="classArAction.html" title="Base class for actions. ">ArAction</a> and add it to the supplied <a class="el" href="classArRobot.html" title="Central class for communicating with and operating the robot. ">ArRobot</a>. The <a class="el" href="classArModule.html#a6774bb941d02907c8e4187011a9f3f8d" title="Initialize the module. The module should use the supplied ArRobot pointer. ">init()</a> takes a reference to an <a class="el" href="classArRobot.html" title="Central class for communicating with and operating the robot. ">ArRobot</a>. The module should use that robot for its purposes. If the module wants to use more robots, assuming there are multiple robots, it can use <a class="el" href="classAria.html#ab79a01958af8db8d1c38d62968c96dfa" title="Get a copy of the global robot list. ">Aria::getRobotList()</a> to find all the <a class="el" href="classArRobot.html" title="Central class for communicating with and operating the robot. ">ArRobot</a> instantiated. The module should do all its clean up in <a class="el" href="classArModule.html#a6556f5f806fbbd4f25b0c6f0c2997984" title="Close down the module and have it exit. ">exit()</a>.</p>
<p>The user should derive their own class from <a class="el" href="classArModule.html" title="Dynamicly loaded module base class, read warning in more. ">ArModule</a> and implement the <a class="el" href="classArModule.html#a6774bb941d02907c8e4187011a9f3f8d" title="Initialize the module. The module should use the supplied ArRobot pointer. ">init()</a> and <a class="el" href="classArModule.html#a6556f5f806fbbd4f25b0c6f0c2997984" title="Close down the module and have it exit. ">exit()</a> functions. The users code should always clean up when <a class="el" href="classArModule.html#a6556f5f806fbbd4f25b0c6f0c2997984" title="Close down the module and have it exit. ">exit()</a> is called. <a class="el" href="classArModule.html#a6556f5f806fbbd4f25b0c6f0c2997984" title="Close down the module and have it exit. ">exit()</a> is called right before the module (dynamic library .dll/.so) is closed and removed from the program.</p>
<p>The macro ARDEF_MODULE() must be called within the .cpp file of the users module. A global instance of the users module must be defined and a reference to that instance must be passed to ARDEF_MODULE(). This allows the <a class="el" href="classArModuleLoader.html" title="Dynamic ArModule loader. ">ArModuleLoader</a> to find the users module class and invoke it.</p>
<p>One thing to note about the use of code wrapped in ArModules and staticly linking in that code. To be able to staticly link .cpp files which contain an <a class="el" href="classArModule.html" title="Dynamicly loaded module base class, read warning in more. ">ArModule</a>, the ARIA_STATIC preprocessor symbol should be defined. This will cause the ARDEF_MODULE() to do nothing. If it defined its normal functions and variables, the linker would fail to staticly link in multiple modules since they all have symbols with the same name.</p>
<p>Refer to <a class="el" href="classArModuleLoader.html" title="Dynamic ArModule loader. ">ArModuleLoader</a> to see how to load an <a class="el" href="classArModule.html" title="Dynamicly loaded module base class, read warning in more. ">ArModule</a> into a program.</p>
<p>For examples, see the programs advanced/simpleMod.cpp and advanced/simpleModule.cpp. </p>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="moduleExample_Mod_8cpp-example.html#_a0">moduleExample_Mod.cpp</a>.</dd>
</dl></div><h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a6774bb941d02907c8e4187011a9f3f8d"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">virtual bool ArModule::init </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="classArRobot.html">ArRobot</a> *&#160;</td>
          <td class="paramname"><em>robot</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">void *&#160;</td>
          <td class="paramname"><em>argument</em> = <code>NULL</code>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">pure virtual</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">

<p>Initialize the module. The module should use the supplied <a class="el" href="classArRobot.html" title="Central class for communicating with and operating the robot. ">ArRobot</a> pointer. </p>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramname">robot</td><td>Robot this module should attach to or operate on. Note, may be NULL.</td></tr>
    <tr><td class="paramname">argument</td><td>an optional argument passed to the module. Default is NULL. The module can interpret this in any way, it is recommended that you make sure this is documented if used. </td></tr>
  </table>
  </dd>
</dl>
<dl><dt><b>Examples: </b></dt><dd><a class="el" href="moduleExample_Mod_8cpp-example.html#a1">moduleExample_Mod.cpp</a>.</dd>
</dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>ArModule.h</li>
<li>ArModule.cpp</li>
</ul>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="classArModule.html">ArModule</a></li>
    <li class="footer">Generated by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.11 </li>
  </ul>
</div>
</body>
</html>
